<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>个人中心-评论管理</title>
    <div data-th-replace="~{fragment/common :: common}"></div>
</head>
<body>
<div data-th-replace="~{fragment/header :: header}"></div>
<div class="body-container container" style="margin-top: 20px">
    <div class="col-sm-2 my-nav">
        <ul data-th-replace="~{fragment/my-nav :: my-nav(activeUrl='my-comments')}"></ul>
    </div>
    <div class="col-sm-10 my-content">
        <div class="panel panel-default">
            <!-- Default panel contents -->
            <div class="panel-heading">
                <h4>评论管理
                </h4>
            </div>
            <div class="panel-body">
                <ul class="nav nav-tabs" style="padding-top: 10px;">
                    <li class="active" data-th-class="${type=='from'?'active':''}">
                        <a data-th-href="@{'/my/comments?type=from'}">我的文章评论</a>
                    </li>
                    <li data-th-class="${type=='to'?'active':''}">
                        <a data-th-href="@{'/my/comments?type=to'}">我发表的评论</a>
                    </li>
                </ul>
                <div style="margin-top: 10px;min-height: 300px;height: auto;">
                    <div data-th-each="comment : ${records}" style="    padding: 10px 0;">
                        <div style="width: 100%;background-color: #F2F2F2;" data-th-if="${type=='from'}">
                            <a class="author-div" style="padding-left: 10px" target="_blank"
                               data-th-href="@{${comment.website}}"
                               data-th-text="${comment.nickname}"></a>
                            <span class="tag-div">
                                <span class="glyphicon glyphicon-time"></span>
                                <span data-th-text="${#dates.format(comment.createTime,'yyyy/MM/dd HH:mm')}"></span>
                            </span>
                            评论了你的文章
                            <span class="tag-div">
                                <a data-th-href="@{'/blog/a/'+${comment.articleId}}" target="_blank"
                                   style="color: #337AB7">
                                    <span data-th-text="${comment.articleName}"></span>
                                </a>
                            </span>
                            <form style="width: 40px;float: right;margin-right: 10px; margin-top: 4px;" data-th-action="@{/my/comment/delete}" method="post">
                                <input type="hidden" name="id" data-th-value="${comment.id}">
                                <input type="submit" value="删除" class="btn btn-xs btn-danger"/>
                            </form>
                            <div data-th-utext="${comment.content}"
                                 style="border-top: 1px solid #DDDDDD;margin-top: 8px;padding: 5px 10px;background-color: #F7F7F7">
                            </div>
                        </div>
                        <div style="width: 100%;background-color: #F2F2F2;" data-th-if="${type=='to'}">
                            <span class="tag-div" style="padding-left: 10px">我</span>
                            <span class="tag-div">
                                <span class="glyphicon glyphicon-time"></span>
                                <span data-th-text="${#dates.format(comment.createTime,'yyyy/MM/dd HH:mm')}"></span>
                            </span>
                            评论了文章
                            <span class="tag-div">
                                <a data-th-href="@{'/blog/a/'+${comment.articleId}}" target="_blank"
                                   style="color: #337AB7">
                                    <span data-th-text="${comment.articleName}"></span>
                                </a>
                            </span>

                            <div data-th-utext="${comment.content}"
                                 style="border-top: 1px solid #DDDDDD;margin-top: 8px;padding: 5px 10px;background-color: #F7F7F7">
                            </div>
                        </div>
                    </div>
                </div>
                <div data-th-replace="~{fragment/page :: page(url='/my/comments?type='+${type}+'&')}">...</div>
            </div>
        </div>
    </div>
</div>
<div data-th-replace="~{fragment/footer :: footer}">...</div>
</body>
</html>